//
//  NSDictionary+KCDefaultValue.h
//  KCDriver
//
//  Created by bjkcwl-fth on 2020/9/16.
//  Copyright © 2020 bjkcwl. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDictionary (KCDefaultValue)

/// 安全取BOOL
/// @param key BOOL对应的key
/// @param defaultValue 默认值 默认为NO
- (BOOL)getBoolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
- (BOOL)getBoolForKey:(NSString *)key;

/// 安全取integer
/// @param key integer对应的key
/// @param defaultValue 默认值 默认为0
- (NSInteger)getIntegerForKey:(NSString *)key defaultValue:(NSInteger)defaultValue;
- (NSInteger)getIntegerForKey:(NSString *)key;

/// 安全取double
/// @param key double对应的key
/// @param defaultValue 默认值 默认为0.0
- (double)getDoubleForKey:(NSString *)key defaultValue:(double)defaultValue;
- (double)getDoubleForKey:(NSString *)key;

/// 安全取string
/// @param key string对应的key
/// @param defaultValue 默认值 默认为@""
- (NSString *)getStringForKey:(NSString *)key defaultValue:(NSString *)defaultValue;
- (NSString *)getStringForKey:(NSString *)key;

/// 安全取array
/// @param key array对应的key
/// @param defaultValue 默认值 默认为@[]
- (NSArray *)getArrayForKey:(NSString *)key defaultValue:(NSArray *)defaultValue;
- (NSArray *)getArrayForKey:(NSString *)key;

/// 安全取dic
/// @param key dic对应的key
/// @param defaultValue 默认值 默认为@{}
- (NSDictionary *)getDictionaryForKey:(NSString *)key defaultValue:(NSDictionary *)defaultValue;
- (NSDictionary *)getDictionaryForKey:(NSString *)key;

@end

NS_ASSUME_NONNULL_END
